package com.flyco.modules.stm.entity;

import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.flyco.poi.excel.annotation.Excel;

/**
 * @Description: 业务和出入库关联表
 * @Author: flyco
 * @Date:   2022-11-29
 * @Version: V1.0
 */
@Data
@TableName("stm_biz_inout_relation")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="stm_biz_inout_relation对象", description="业务和出入库关联表")
public class StmBizInoutRelation {
    
	/**id*/
	@TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "id")
	private Long id;
	/**商家id*/
	@Excel(name = "商家id", width = 15)
    @ApiModelProperty(value = "商家id")
	private Long partnerId;
	/**当前店铺id*/
	@Excel(name = "当前店铺id", width = 15)
    @ApiModelProperty(value = "当前店铺id")
	private Long storeId;
	/**当前店铺名称*/
	@Excel(name = "当前店铺名称", width = 15)
    @ApiModelProperty(value = "当前店铺名称")
	private String storeName;
	/**来源店铺id*/
	@Excel(name = "来源店铺id", width = 15)
    @ApiModelProperty(value = "来源店铺id")
	private Long sourceStoreId;
	/**来源店铺名称*/
	@Excel(name = "来源店铺名称", width = 15)
    @ApiModelProperty(value = "来源店铺名称")
	private String sourceStoreName;
	/**1：待出库/待入库，4:已取消，5：部分发货/收货，7：已完成/已出库/已入库*/
	@Excel(name = "1：待出库/待入库，4:已取消，5：部分发货/收货，7：已完成/已出库/已入库", width = 15)
    @ApiModelProperty(value = "1：待出库/待入库，4:已取消，5：部分发货/收货，7：已完成/已出库/已入库")
	private Integer status;
	/**出入库类型STOCK_IN入库，STOCK_OUT出库*/
	@Excel(name = "出入库类型STOCK_IN入库，STOCK_OUT出库", width = 15)
    @ApiModelProperty(value = "出入库类型STOCK_IN入库，STOCK_OUT出库")
	private String type;
	/**业务类型*/
	@Excel(name = "业务类型", width = 15)
    @ApiModelProperty(value = "业务类型")
	private String stockBizType;
	/**来源单据类型*/
	@Excel(name = "来源单据类型", width = 15)
    @ApiModelProperty(value = "来源单据类型")
	private String sourceType;
	/**来源单据id(调拨单，要货单，退仓单)*/
	@Excel(name = "来源单据id(调拨单，要货单，退仓单)", width = 15)
    @ApiModelProperty(value = "来源单据id(调拨单，要货单，退仓单)")
	private Long sourceId;


	@ApiModelProperty(value = "来源单据id(调拨单，要货单，退仓单)")
	@TableField(exist = false)
	private String sourceIdStr;

	/**订单号*/
	@Excel(name = "订单号", width = 15)
    @ApiModelProperty(value = "订单号")
	private String orderId;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
	private String note;
	/**删除状态(0-正常,1-已删除)*/
	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
	private Integer cancelFlag;
	/**创建人*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**更新人*/
	@Excel(name = "更新人", width = 15)
    @ApiModelProperty(value = "更新人")
	private String updateBy;
	/**更新时间*/
	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
	private Date updateTime;

	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@TableField(exist=false)
	private Date startTime;

	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@TableField(exist=false)
	private Date endTime;

	public String getSourceIdStr(){
		return sourceId==null ? "":sourceId.toString();
	}

	@ApiModelProperty(value = "发货单号")
	private String sendOrderId;

}
